'use strict';

const Service = require('egg').Service;
class OperationLogService extends Service {
  async list(params) {
    return await this.ctx.modelmysql.OperationLog.findAndCountAll({
      where: { tid: params.tid },
      order: [[ 'date', 'DESC' ]],
      offset: parseInt((params.page - 1) * params.limit),
      limit: parseInt(params.limit),
    });
  }
}

module.exports = OperationLogService;
